package com.hyq.visitor;

import java.util.Random;

/**
* @ClassName: ObjectStruture 
* @Description: 结构对象
* @author Janus
 */
public class ObjectStruture {
	//对象生成器，这里通过一个工厂方法模式模拟
	public static Element createElement(){
		Random rand= new Random();
		return rand.nextInt(100) > 50 ? new ConcreteElement1() :  new ConcreteElement2();
	}
}
